AppService   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 9
dl 0
loc 12
rs 10
c 0
b 0
f 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A accumulate 0 3 1
1
import { Controller, Inject } from '@nestjs/common';
2
import { EventPattern } from '@nestjs/microservices';
3
import { TRANSPORT_EVENT_BUS_PATTERN, TRANSPORT_EVENT_BUS_SERVICE, TransportEvent } from 'nestjs-transport-eventbus';
4
import { IEvent, IEventBus } from '@nestjs/cqrs';
5
6
@Controller()
7
export class AppService {
8
9
  constructor(
10
      @Inject(TRANSPORT_EVENT_BUS_SERVICE) private readonly eventBus: IEventBus
11
  ){
12
13
  }
14
  @EventPattern(TRANSPORT_EVENT_BUS_PATTERN)
15
  accumulate(@TransportEvent() event: IEvent): void {
16
    this.eventBus.publish(event);
17
  }
18
}
19